#ifndef __LIST_SCAN_CPP__
#define __LIST_SCAN_CPP__
#include "../include/all.h"


class Student;
class Course;

template <>
void List<Student>::scan() {
    Printer prt;
    auto pnew = new Node<Student>;
    while (
        prt.fmtln(L"请输入第{}个学生的信息, 空行停止输入:", counter + 1),
        pnew->data.scan()) {

        pnew->data.sno = ++counter;
        tail = tail->cat(pnew);
        pnew = new Node<Student>;
    }
    delete pnew;
}

template <>
void List<Course>::scan() {
    Printer prt;
    auto pnew = new Node<Course>;
    while (
        prt.fmtln(L"请输入第{}个课程的信息, 空行停止输入:", counter + 1),
        pnew->data.scan()) {

        pnew->data.cno = ++counter;
        tail = tail->cat(pnew);
        pnew = new Node<Course>;
    }
    delete pnew;
}


#endif /* __LIST_SCAN_CPP__ */